package com.zc.basic.app.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zc.basic.domain.pojo.PvStationInfo;
import com.zc.basic.domain.pojo.gis.GeoPoint;
import com.zc.basic.infra.service.PvStationInfoService;
import com.zc.commons.pojo.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Response;
import java.math.BigDecimal;

@RestController
@RequestMapping(value = "/pv")
public class PvStationController {

    @Autowired
    private PvStationInfoService pvStationInfoService;

    @PostMapping("/add")
    public ResponseData<String> addStation(@RequestBody PvStationInfo stationInfo) {

        stationInfo.setCoordinate(new GeoPoint(new BigDecimal("23.3535"), new BigDecimal("54.897967")));
        pvStationInfoService.save(stationInfo);

        return ResponseData.ok("成功！");
    }


}
